﻿using Microsoft.CodeAnalysis;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Pchp.CodeAnalysis.Symbols
{
    /// <summary>
    /// A base class for synthesized methods that want a this parameter.
    /// </summary>
    internal abstract class SynthesizedInstanceMethodSymbol : MethodSymbol
    {
        //private ParameterSymbol _lazyThisParameter;

        public override ImmutableArray<SyntaxReference> DeclaringSyntaxReferences
        {
            get
            {
                return ImmutableArray<SyntaxReference>.Empty;
            }
        }

        public sealed override bool IsImplicitlyDeclared
        {
            get
            {
                return true;
            }
        }

        //internal override bool TryGetThisParameter(out ParameterSymbol thisParameter)
        //{
        //    Debug.Assert(!IsStatic);

        //    if ((object)_lazyThisParameter == null)
        //    {
        //        Interlocked.CompareExchange(ref _lazyThisParameter, new ThisParameterSymbol(this), null);
        //    }

        //    thisParameter = _lazyThisParameter;
        //    return true;
        //}

        /// <summary>
        /// Returns data decoded from Obsolete attribute or null if there is no Obsolete attribute.
        /// This property returns ObsoleteAttributeData.Uninitialized if attribute arguments haven't been decoded yet.
        /// </summary>
        internal sealed override ObsoleteAttributeData ObsoleteAttributeData
        {
            get { return null; }
        }

        //internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
        //{
        //    throw ExceptionUtilities.Unreachable;
        //}
    }
}
